package com.pptv.ads.core.utils;

public class PathUtil {
	
	public static String combinePath(String ... paths){
		String res = "/";
		for(String path : paths){
			res = combinePath(res, path);
		}
		return res;
	}
	
	private static String combinePath(String path1,String path2){
		boolean flag1 = path1.endsWith("/");
		boolean flag2 = path2.startsWith("/");
		if(flag1 && flag2){
			return path1 + path2.substring(1);
		}else if(!flag1 && ! flag2){
			return path1.trim() + "/" + path2.trim();
		}else {
			return path1.trim() + path2.trim();
		}
	}
	
	
}
